:host {
  --phone-display: block;
  --phone-collapse-display: none;
  --phone-header-height: 48px;
  --phone-body-height: 667px;
  
  @media screen and (max-width: 960px) {
    --phone-display: none;
    --phone-collapse-display: flex;
  }
}

.TDesign-doc-phone {
  width: 375px;
  width: ~"min(75vw, 375px)";
  border-radius: 6px;
  border: 1px solid var(--component-border);
  outline: 9999px solid transparent;
  position: absolute;
  top: 316px;
  right: 24px;
  display: var(--phone-display);

  &__close {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--component-border);
    border-radius: 0 6px 6px 0;
    position: absolute;
    right: -42px;
    top: 42px;
    background-color: var(--bg-color-container);
    visibility: hidden;
    opacity: 0;
    transition: all .2s linear;

    svg {
      color: var(--text-primary);
      width: 24px;
      height: 24px;
    }
  }

  &__header {
    height: var(--phone-header-height);
    padding: 8px;
    border-radius: 6px 6px 0 0;
    box-sizing: border-box;
    background: var(--bg-color-demo);

    &-icons {
      display: flex;
      height: 100%;

      .icon {
        width: 32px;
        height: 32px;
        border-radius: var(--border-radius);
        transition: all .1s;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-secondary);

        &:hover {
          color: var(--text-primary);
          background-color: var(--bg-color-demo-hover);
        }

        &.active {
          color: var(--text-primary);
          background-color: var(--bg-color-demo-select);
        }
      }

      .qrcode-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 3px;
        overflow: hidden;
        max-width: 200px;
        max-height: 200px;
      }
    }
  }

  &__body {
    width: 100%;
    height: var(--phone-body-height);
    border-radius: 0 0 6px 6px;
    background-color: var(--bg-color-demo);
  }
}

.TDesign-doc-phone-mask {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 2500;
  display: none;

  &.show {
    display: block;
  }

  &.hide + .TDesign-doc-phone {
    visibility: hidden;
    opacity: 0;
  }

  &.show + .TDesign-doc-phone {
    position: fixed;
    left: 50%;
    top: 50% !important;
    transform: translate3d(-50%, -50%, 0);
    outline-color: var(--text-disabled);
    transition: transform .2s var(--anim-time-fn-easing), opacity .2s linear, visibility .2s linear;
    visibility: visible;
    opacity: 1;
    z-index: 2500;
    display: block;

    .TDesign-doc-phone__close {
      opacity: 1;
      visibility: visible;
      cursor: pointer;
    }
  }
}

.TDesign-doc-phone-collapse {
  position: fixed;
  right: 0;
  top: 400px;
  z-index: 400;
  border-radius: 3px 0 0 3px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, .26);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color-container);
  transition: all .2s var(--anim-time-fn-easing);
  display: var(--phone-collapse-display);
  cursor: pointer;

  .icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
  }
}
